<?php

/**
 * Framework_Presenter_Smarty_CharEncode
 *
 * @author Application Support Group
 * @copyright University of Georgia
 * @license http://www.opensource.org/licenses/gpl-license.php
 * @package BAMF
 * @filesource
*/


/**
 * Framework_Presenter_Smarty_CharEncode
 *
 *
 * @author Application Support Group
 * @package BAMF
 * @link http://smarty.php.net
*/
class Framework_Presenter_Smarty_CharEncode extends Framework_Presenter_Smarty_Extension {

	public function __construct() {
		parent::__construct() ;
	}

	public static function register( &$smartyObj ) {
		$smartyObj->register_modifier( 
			"charEncode", 
			array( __CLASS__, "smarty_modifier_charEncode" )
			) ;
	}

	// apply specified character encoding to the passed string
	public function smarty_modifier_charEncode( $aString, $char_set='ISO-8859-1' ) {
		return Framework_Util_CharacterEncoder::encode( $aString, ENT_QUOTES, $char_set ) ;
	}

	public function __destruct() {}

}
